Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
The moment npm package is a JavaScript library for parsing, validating, manipulating, and formatting dates. It is widely used for handling dates and times in Node.js and browser applications.
Parsing
Parse a date string into a moment object.
moment('2023-04-05')
Validation
Check if a date is valid.
moment('2023-04-05').isValid()
Manipulation
Manipulate dates by adding time to the current date.
moment().add(7, 'days')
Formatting
Format a moment date object into a string in a specified format.
moment().format('YYYY-MM-DD')
Query
Query dates to compare them.
moment().isBefore('2023-12-25')
Provides a collection of simple, pure functions for manipulating JavaScript dates. It is modular, allowing you to pick and choose which functions you need, and is generally considered to be a lighter-weight alternative to moment.
Created by one of the original Moment.js team members, Luxon is a modern library for working with dates and times. It offers a fluent API and aims to have a smaller footprint than moment.
Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. It is lightweight and its API is designed to be familiar to Moment.js users.
A JavaScript date library for parsing, validating, manipulating, and formatting dates.
Moment.js is a legacy project, now in maintenance mode. In most cases, you should choose a different library.
For more details and recommendations, please see Project Status in the docs.
Thank you.
Moment.js is freely distributable under the terms of the MIT license.
2.30.1
FAQs
Parse, validate, manipulate, and display dates
The npm package moment receives a total of 19,928,498 weekly downloads. As such, moment popularity was classified as popular.
We found that moment demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.